package com.music.chain;

import com.music.comstan.enums.MusicProviderEnum;
import com.music.core.api.MusicApi;
import com.music.core.api.MusicApiFactory;

/**
 * @author zhanghuiyong
 * @创建时间 2019年07月31日
 * @描述: 音乐统一链路管理
 **/

public class MusicChain {
    /**
     * 链路分发
     *
     * @return
     */
    public static MusicApi execute(String type) {
        /**
         * 缺席 Kuwo("酷我音乐", KuwoMusicApi.class),
         */
        /** 获取所有链路 */
        if (type.equals(MusicProviderEnum.Netease.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Netease);
        } else if (type.equals(MusicProviderEnum.Migu.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Migu);
        } else if (type.equals(MusicProviderEnum.QQ.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.QQ);
        } else if (type.equals(MusicProviderEnum.Yiting.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Yiting);
        } else if (type.equals(MusicProviderEnum.Kugou.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Kugou);
        } else if (type.equals(MusicProviderEnum.Xiami.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Xiami);
        } else if (type.equals(MusicProviderEnum.Weibo.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Weibo);
        } else if (type.equals(MusicProviderEnum.Baidu.toString())) {
            return MusicApiFactory.create(MusicProviderEnum.Baidu);
        }
        return MusicApiFactory.create(MusicProviderEnum.Netease);
    }


}
